<script>
import MarkdownIt from 'markdown-it'
import store from "../../store/index.js";

export default {
  name: "ReadMessageDialog",
  computed: {
    store() {
      return store
    },
    contentHtml() {
      return this.markdown.render(this.store.state.readMessage.content)
    }
  },
  data() {
    return {
      markdown: new MarkdownIt()
    }
  },
  methods: {

  }
}
</script>

<template>
  <el-dialog
      v-model="store.state.readMessageDialogVisible"
      :title="store.state.readMessage.title"
      destroy-on-close
  >
    <span v-html="contentHtml"></span>
    <template #footer>
      <el-button type="primary" @click="store.state.readMessageDialogVisible = false">
        确定
      </el-button>
    </template>
  </el-dialog>
</template>

<style scoped>

</style>